import { createApp } from 'vue'
import App from './App.vue'
import router from './router' 
import ElementPlus from 'element-plus'
import pinia from "./stores/store"
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 导入权限控制模块
import './permission' 
import 'virtual:svg-icons-register'
import "@/styles/element/index.scss"
import '@/styles/index.scss'

import installDirective from '@/directives'
import {formatDt} from '@/utils/formatDt'

const app = createApp(App)
app.config.globalProperties.$formatDt = formatDt
app.config.globalProperties.$baseUrl = import.meta.env.VITE_APP_BASE_URL

app.config.warnHandler = () => null; 

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
installDirective(app) 
app.use(pinia)
app.use(router)   
app.use(ElementPlus, {
    locale: zhCn,
})
app.mount('#app')
